﻿<%@ Page Title="" Language="C#" MasterPageFile="~/Shared/Site.Master" AutoEventWireup="true"
    CodeBehind="~/Views/Personal/Skater.aspx.cs" Inherits="EislaufScb.WebForms.Views.Personal.Skater" %>

<asp:Content ID="Content1" ContentPlaceHolderID="HeadContent" runat="server">
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="MainContent" runat="server">
    <script type="text/javascript" language="javascript">
        $(document).ready(function () {
            $('table').each(function () {
                $(this).css("height", "100%");
            });
        });

        function ShowSkaterDetails(firstName, lastName, imageClientID) {
            $.ajax({
                type: "POST",
                url: "Skater.aspx/GetSkaterDetails",
                data: "{firstName : " + "'" + firstName + "'" + ", lastName: " + "'" + lastName + "'" + "}",
                contentType: "application/json; charset=utf-8",
                dataType: "json",
                success: function (result) {
                    var image = $('#' + imageClientID + '');

                    var modalPopUpImage = $('#ModalPopUpImage');
                    modalPopUpImage[0].width = image[0].naturalWidth;
                    modalPopUpImage[0].height = image[0].naturalHeight;
                    modalPopUpImage[0].src = image[0].src;

                    var certifications = "";
                    for (var i = 0; i < result.d.Certifications.length; i++) {
                        certifications += result.d.Certifications[i] + "<BR />";
                    }

                    $('#IsTrainedBy')[0].innerHTML = result.d.PersonIsTrainedBy;
                    $('#Certifications')[0].innerHTML = certifications;

                    $('#ModalPopUp').dialog({ modal: true, buttons: { OK: function () { $(this).dialog("close"); } }, width: image[0].naturalWidth + 60 });
                },
                error: function (errormessage) {
                    alert(errormessage);
                }
            });
        }
    </script>
    <h2>
        SKATERS
    </h2>
    <div id="ContentDiv" class="imagesGalleryOverFlowDiv">
        <asp:DataList ID="SkaterDataList" runat="server" RepeatColumns="2" OnItemDataBound="SkaterDataList_OnItemDataBound"
            GridLines="Both" ItemStyle-CssClass="SkatersColumnWidht">
            <ItemStyle CssClass="SkatersColumnWidht"></ItemStyle>
            <ItemTemplate>
                <div id="ContentDiv" class="SkaterDataListStyles imageMargin">
                    <table id="DetailsTable">
                        <tr>
                            <td class="SkatersLabelWidth">
                                <asp:Image ID="SkaterImage" runat="server" Height="128" Width="128" />
                            </td>
                            <td class="SkatersLabelWidth SkatersTitle">
                                <h2 runat="server">
                                    <asp:Label Text='<% #Eval("FirstName") %>' runat="server" />
                                    <asp:Label Text='<% #Eval("LastName") %>' runat="server" />
                                </h2>
                            </td>
                        </tr>
                        <%--                        <tr class="SkatersRowHeight">
                            <td class="SkatersLabelWidth">
                                Trainiert von:
                            </td>
                            <td class="SkatersLabelWidth">
                                <asp:Label Text='<% #Eval("PersonIsTrainedBy") %>' runat="server" />
                            </td>
                        </tr>
                        <tr class="SkatersRowHeight">
                            <td class="SkatersLabelWidth">
                                <asp:Label ID="CertificationLabel" Text="Bestandene Tests:" runat="server" />
                            </td>
                            <td class="SkatersLabelWidth">
                                <asp:BulletedList ID="CertificationList" runat="server">
                                </asp:BulletedList>
                            </td>
                        </tr>--%>
                    </table>
                </div>
            </ItemTemplate>
        </asp:DataList>
    </div>
    <div id="ModalPopUp">
        <img id="ModalPopUpImage" height="0" width="0" src="#" alt="Alternate Text" />
        <table border="0" cellpadding="0" cellspacing="0">
            <tr>
                <td>
                    Trainiert von:
                </td>
                <td>
                <div id="IsTrainedBy">
                </div>
                </td>
            </tr>
            <tr>
                <td>
                Bestandene Tests:
                </td>
                <td>
                <div id="Certifications"></div>
                </td>
            </tr>
        </table>
    </div>
</asp:Content>
